﻿using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace MyUtilitiesTest.Logging
{
    public class InMemoryTraceListener
        : TraceListener
    {
        public override void Write(String message)
        {
            messages_.Add(message);
        }

        public override void WriteLine(String message)
        {
            messages_.Add(message + Environment.NewLine);
        }

        readonly List<String> messages_ = new List<String>();

        public List<String> Messages
        {
            get { return messages_; }
        } 
    }
}
